#include <stdio.h>
#include <unistd.h>
#include <string.h>

#define SIZE 101
#define SIGN '='

int main()
{
  char ch[SIZE];
  char* lab = "\\|/";

  memset(ch, '\0', sizeof(ch));

  int i = 0;
  while(i <= 100)
  {
    //还可以通过修改，字体和背景色进一步的优化
    printf("[%-100s][%d%%][%c]\r", ch, i, lab[i%4]);
    fflush(stdout);
    ch[i++] = SIGN;
    usleep(100000);
  }
  
  printf("\nCompelet!\n");
  return 0;
}
